<?php
/***************************************************************
 *  Copyright notice
 *
 *  (c) 2011 Florian Müller <it-admin@ifp-potsdam.co>, IFP
 *
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
 *
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/

/**
 * Dozent
 */
class Tx_IfpCurriculum2_Domain_Model_Dozent extends Tx_Extbase_DomainObject_AbstractEntity {

	/**
	 * Titel
	 *
	 * @var string
	 */
	protected $titel;

	/**
	 * Geschlecht
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $geschlecht;

	/**
	 * Vorname
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $vorname;

	/**
	 * Nachname
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $nachname;

	/**
	 * Kurz Beschreibung
	 *
	 * @var string
	 */
	protected $beschreibungKurz;

	/**
	 * Beschreibung
	 *
	 * @var string
	 */
	protected $beschreibung;
	/**
	 *Veröffentlichungen
	 *
	 * @var string
	 */
	protected $veroeffentlichungen;

	/**
	 * Dozent/Supervisor/Lehrbeauftragter
	 *
	 * @var string
	 */
	protected $type;

	/**
	 * Bild
	 *
	 * @var string
	 * @file Tx_IfpCurriculum2_Resource_File
	 */
	protected $bild;

	/**
	 * mail
	 *
	 * @var string
	 */
	protected $mail;
	/**
	* Homepage
	*
	* @var string
	*/
	protected $homepage;
	/**
	 * stadt
	 *
	 * @var string
	 */
	protected $stadt;
	/**
	* Straße/Hausnur
	*
	* @var string
	*/
	protected $strassehnr;
	/**
	* plz
	*
	* @var string
	*/
	protected $plz;
	/**
	* plz
	*
	* @var string
	*/
	protected $telefon;

	/**
	 * Extern
	 *
	 * @var boolean
	 */
	protected $extern;
	/**
	 *
	 * Enter description here ...
	 * @var array
	 */
	protected $typeDef=array(0=>'D',1=>'S',2=>'SE');
	/**
	* TP/AP/..
	*
	* @var string
	*/
	protected $fachbereich;
	/**
	*
	* TP/AP/ÄWB/KPT/GrTh
	* @var array
	*/
	protected $fachbereichDef=array(0=>'TP',1=>'AP',2=>'ÄWB',3=>'KPT',4=>'GrTH');
	/**
	 *
	 * Enter description here ...
	 * @var array
	 */
	protected $typeDefLong=array(0=>'Dozent',1=>'Supervisor',2=>'Selbsterfahrungsleiter');


	public function __construct(){
		
	}
	/**
	 * @param string $titel
	 * @return void
	 */
	public function setTitel($titel) {
		$this->titel = $titel;
	}

	/**
	 * @return string
	 */
	public function getTitel() {
		return $this->titel;
	}

	/**
	 * @param string $geschlecht
	 * @return void
	 */
	public function setGeschlecht($geschlecht) {
		$this->geschlecht = $geschlecht;
	}

	/**
	 * @return string
	 */
	public function getGeschlecht() {
		return $this->geschlecht;
	}

	/**
	 * @param string $vorname
	 * @return void
	 */
	public function setVorname($vorname) {
		$this->vorname = $vorname;
	}

	/**
	 * @return string
	 */
	public function getVorname() {
		return $this->vorname;
	}

	/**
	 * @param string $nachname
	 * @return void
	 */
	public function setNachname($nachname) {
		$this->nachname = $nachname;
	}

	/**
	 * @return string
	 */
	public function getNachname() {
		return $this->nachname;
	}

	/**
	 * @param string $beschreibungKurz
	 * @return void
	 */
	public function setBeschreibungKurz($beschreibungKurz) {
		$this->beschreibungKurz = $beschreibungKurz;
	}

	/**
	 * @return string
	 */
	public function getBeschreibungKurz() {
		return $this->beschreibungKurz;
	}

	/**
	 * @param string $beschreibung
	 * @return void
	 */
	public function setBeschreibung($beschreibung) {
		$this->beschreibung = $beschreibung;
	}

	/**
	 * @return string
	 */
	public function getBeschreibung() {
		return $this->beschreibung;
	}
/**
	 * @param string $veroeffentlichungen
	 * @return void
	 */
	public function setVeroeffentlichungen($veroeffentlichungen) {
		$this->veroeffentlichungen = $veroeffentlichungen;
	}

	/**
	 * @return string
	 */
	public function getVeroeffentlichungen() {
		return $this->veroeffentlichungen;
	}

	/**
	 * @param string $type
	 * @return void
	 */
	public function setType($type) {
		$this->type = $type;
	}

	/**
	 * @return string
	 */
	public function getType() {
		return $this->type;
	}
	/**
	* @param string $type
	* @return void
	*/
	public function setFachbereich($fachbereich) {
		$this->fachbereich = $fachbereich;
	}
	
	/**
	 * @return string
	 */
	public function getFachbereich() {
		return $this->fachbereich;
	}
/**
	 * @param string $stadt
	 * @return void
	 */
	public function setStadt($stadt) {
		$this->stadt = $stadt;
	}

	/**
	 * @return string
	 */
	public function getStadt() {
		return $this->stadt;
	}

	/**
	 * @param string $bild
	 * @return void
	 */
	public function setBild($bild) {
		$this->bild = $bild;
	}

	/**
	 * @return string
	 */
	public function getBild() {
		return $this->bild;
	}

	/**
	 * @param string $mail
	 * @return void
	 */
	public function setMail($mail) {
		$this->mail = $mail;
	}

	/**
	 * @return string
	 */
	public function getMail() {
		return $this->mail;
	}
	/**
	* @param string $strassehnr
	* @return void
	*/
	public function setStrassehnr($strassehnr) {
		$this->strassehnr = $strassehnr;
	}
	
	/**
	 * @return string
	 */
	public function getStrassehnr() {
		return $this->strassehnr;
	}
	/**
	* @param string $plz
	* @return void
	*/
	public function setPlz($plz) {
		$this->plz = $plz;
	}
	
	/**
	 * @return string
	 */
	public function getPlz() {
		return $this->plz;
	}
	/**
	* @param string $telefon
	* @return void
	*/
	public function setTelefon($telefon) {
		$this->telefon = $telefon;
	}
	
	/**
	 * @return string
	 */
	public function getTelefon() {
		return $this->telefon;
	}
	/**
	* @param string $homepage
	* @return void
	*/
	public function setHomepage($homepage) {
		$this->homepage = $homepage;
	}
	
	/**
	 * @return string
	 */
	public function getHomepage() {
		return $this->homepage;
	}

	/**
	 * @param boolean $extern
	 * @return void
	 */
	public function setExtern($extern) {
		$this->extern = $extern;
	}

	/**
	 * @return boolean
	 */
	public function getExtern() {
		return $this->extern;
	}

	/**
	 * @return boolean
	 */
	public function isExtern() {
		return $this->getExtern();
	}

	public function getName(){
		return $this->titel." ". $this->vorname." ".$this->nachname;
	}
	public function getFirstLetterName(){
		return strtoupper (substr($this->getNachname(), 0,1));
	}
/**
 * 
 * @return string
 */
	public function getTypDef(){
		foreach ($this->typeDef as $key =>$typCode) {
			if(strpos($this->type,strval($key)) !== false) {
				if($returnStr)
					$returnStr.=", ".$typCode;
				else
					$returnStr=$typCode;
			}
		}
		return $returnStr;
	}
	/**
	 * 
	 * Enter description here ...
	 * @return string
	 */
	public function getFachbereichDef(){
		foreach ($this->fachbereichDef as $key =>$fachbreichCode) {
			if(strpos($this->fachbereich,strval($key)) !== false) {
				if($returnStr)
				$returnStr.=", ".$fachbreichCode;
				else
				$returnStr=$fachbreichCode;
			}
		}
		return $returnStr;
	}
	public function getTypeDefLong(){
		foreach ($this->typeDefLong as $key =>$typCode) {
			if(strpos($this->type,strval($key)) !== false) {
				if($returnStr)
					$returnStr.=", ".$typCode;
				else
					$returnStr=$typCode;
			}
		}
		return $returnStr;
	}
	
	/**
	 * @return array
	 * Enter description here ...
	 */
	public function getFilter(){
	
		$filter = array();
		
		//Typ
		$filter["="]="=Funktion=";
		foreach ($this->typeDef as $key => $value) {
			$filter["T_".$key]=$value;
		}
		
		$filter["="]="=Fachbereich=";
		foreach ($this->fachbereichDef as $key => $value) {
			$filter["F_".$key]=$value;
		}
		return $filter;
	}

}
?>